import Vue from 'vue'
import VueRouter from 'vue-router'
import MyDiv from '../views/MyDiv.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: MyDiv
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/MyDiv.vue'),
    children:[
    {
      path: '/a1',
      name: 'a1',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import(/* webpackChunkName: "about" */ '../components/ShouYe.vue')
    },
    {
      path: '/a2',
      name: 'a2',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import(/* webpackChunkName: "about" */ '../components/XiangMuTianJia.vue')
    },
  ]
  },
]

const router = new VueRouter({
  routes
})

export default router
